//好友关系
var FriendCon = iClass.set("Friend", function(friend_info) {
	this._id = FriendCon.getUuid($$.md5(friend_info.user_id+friend_info.friend_id));
	this.initInfo(friend_info);

	this.create_time = +new Date;
	db.insert(this.dbname, this);
});
FriendCon.findUserFriendList = function(user_id) {
	var friend_list = db.find_list(FriendCon.dbname, {
		user_id: user_id
	}).map(function(friend) {
		return FriendCon.getInstance(friend);
	});
	return friend_list;
};
FriendCon.findUserFriend = function(user_id, friend_user_id) {
	var friend_info = db.find_one(FriendCon.dbname, {
		user_id: user_id,
		friend_id: friend_user_id
	});
	return friend_info && FriendCon.getInstance(friend_info);
};